    ////////////////////
    // Page Capture
    ////////////////////
    /**
     * Use the `Browser.pageCapture` API to save a tab as MHTML.
     *
     * Permissions: "pageCapture"
     */
    export namespace pageCapture {
        export interface SaveDetails {
            /** The id of the tab to save as MHTML. */
            tabId: number;
        }

        /**
         * Saves the content of the tab with given id as MHTML.
         * @param callback Called when the MHTML has been generated.
         * Parameter mhtmlData: The MHTML data as a Blob.
         */
        export function saveAsMHTML(details: SaveDetails, callback?: (mhtmlData?: Blob) => void): Promise<Blob | undefined> {
            return Wab.callFunctionAsync({ funcName: 'pageCapture.saveAsMHTML', details }).then(res => {
                callback?.(res)
                return res
            })
        }
    }